package org.wing.panel;

import com.tool.btn.FormsOnOffBtn;
import com.tool.image.ImageMixDeal;
import com.tool.role.RoleData;
import com.tool.tcp.GetTcpPath;
import com.tool.tcp.Sprite;
import com.tool.tcp.SpriteFactory;
import com.tool.tcpimg.RichLabel;
import com.tool.tcpimg.UIUtils;
import com.updateNew.MyIsif;
import org.apache.commons.lang.StringUtils;
import org.come.entity.Goodstable;
import org.come.until.*;
import org.wing.btn.LHBtn;
import org.wing.mouseListener.*;

import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.awt.image.ImageObserver;
import java.math.BigDecimal;

/**
 * 翅膀主面板
 *
 * @author 黄港昌 创建时间：2019-06-18
 */
public class LHMainPanel extends JPanel {

    private LHBtn wingMenuBtn, // 翅膀菜单按钮
            upgradeBtn, // 升级菜单按钮
            amtyuranusBtn, // 升星菜单按钮
            qualityBtn, // 品质菜单按钮
            recastMenuBtn, // 重铸菜单按钮
            refineryMenuBtn; // 炼化菜单按钮
    // 左侧面板
    private LHBtn recastBtn;
    private JLabel wingMinImg; // 翅膀小图
    private JLabel chooseWingLab;
    private LHBtn leftBtn, // 左选择按钮
            rightBtn; // 右选择按钮
    private JLabel wingLevel, // 翅膀等级
            wingQuality, // 翅膀品质
            wingStarLevel; // 翅膀星级
    private JLabel experience; // 经验

    // 升星左侧面板
    private JLabel[] starLab; // 星级展示

    // 升级面板右侧初始化控件
    private JLabel[] nowAttributeLab; // 当前属性控件
    private JScrollPane ruleWingScrollPane; // 翅膀规则说明
    // 升级面板右边为物品培养面板时
    // private JScrollPane ruleGoodsScrollPane; //物品培养规则说明
    private JLabel chooseGoodsImg; // 选中培养物品的图片
    private LHBtn cultivateBtn; // 培养按钮
    private LHBtn wingNextPageBtn; // 翅膀面板下一页翻页按钮
    private LHBtn wingLastPageBtn; // 翅膀面板上一页翻页按钮
    private JTextField textNumber; // 数量
    private JLabel numberLab;// 升星数量
    private JLabel[] goodsLab; // 物品培养15格子
    private BigDecimal money = new BigDecimal(0);
    // 升星面板
    private JLabel[] attributeLab, // 属性8个格子
            upStarMaterials, // 升星材料5个格子
            qualityLab, // 当前品质和下个阶段品质2个格子
            wingLab, // 翅膀面板25个格子
            recastAttrLab, // 重铸面板属性4个格子
    // refineryTopLab; // 炼化面板最顶上3个相同格子
    qualityNowLab, // 当前品质和下一阶段品质
            wingRefining; // 翅膀炼化勾选框
    private JLabel recastNowAttribute; // 重铸当前属性
    // recastConsumeImg; // 重铸消耗物品图片
    // recastChoiceLab; // 重铸勾选框
    // private JLabel refineryOneLab; // 炼化面板最顶上1个大格子
    private int pageNumber = 1; // 当前页数
    private BigDecimal wingGoods; // 当前选中的翅膀
    private Goodstable chosegoods; // 当前选中的物品
    private int wingGoodsType; // 当前选中的翅膀位置标识
    private boolean[] wingRefiningType; // 翅膀炼化勾选锁定标识
    private JLabel refiningTitle; // 炼化锁定花费仙玉说明
    private LHBtn refineryBtn;
    private JLabel qualityHint;

    public LHMainPanel() {

        if (MyIsif.getStyle().equals("水墨UI")) {
            this.setPreferredSize(new Dimension(444, 538));
            this.setOpaque(false);
            this.setLayout(null);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/button/1.png", 1, 866);
            offBtn.setBounds(444 - 37, 10, 25, 25);
            this.add(offBtn);

//            this.add(getWingMenuBtn());
//            this.add(getUpgradeBtn());
//            this.add(getAmtyuranusBtn());
            this.add(getRecastMenuBtn());
            this.add(getRefineryMenuBtn());
//            this.add(getQualityBtn());

            this.add(getWingMinImg());
//            this.add(getLeftBtn());
//            this.add(getRightBtn());
//            this.add(getWingLevel());
//            this.add(getWingQuality());
//            this.add(getWingStarLevel());
            this.add(getExperience());
            // this.add(getWingMaxImg());
            // this.add(getShowImg());
            // this.add(getChooseCultivateLab());
            // this.add(getGoodsCultivateBtn());
            // this.add(getDahuabiCultivateBtn());
            // this.add(getXianyuCultivateBtn());
            // this.add(getSummonCultivateBtn());
            this.add(getRuleWingScrollPane());
            // this.add(getRuleGoodsScrollPane());
            this.add(getTextNumber());
            this.add(getCultivateBtn());
            this.add(getChooseGoodsImg());
            getNowAttributeLab();
            getWingNextPageBtn();
            getWingLastPageBtn();
            getGoodsLab();
            getAttributeLab();
            getUpStarMaterials();
//            getStarLab();
            getQualityLab();
            getWingLab();
            getRecastAttrLab();
            getRecastNowAttribute();
            getRecastBtn();
//			 getRecastConsumeImg();
//			 getRecastChoiceLab();
            getRefineryBtn();
//			 getRefineryOneLab();
//			 getRefineryTopLab();
            getNumberLab();
            getQualityNowLab();
            getWingRefining();
            getWingRefiningType();
            getRefiningTitle();
        } else {
            this.setPreferredSize(new Dimension(444, 537));
            this.setOpaque(false);
            this.setLayout(null);

            // 关闭按钮事件
            FormsOnOffBtn offBtn = new FormsOnOffBtn("inkImg/hongmu/s74.png", 1, 866);
            offBtn.setBounds(444 - 25, 0, 23, 23);
            this.add(offBtn);
            this.add(getRecastMenuBtn());
//            this.add(this.getWingMenuBtn());
//            this.add(this.getUpgradeBtn());
//            this.add(this.getAmtyuranusBtn());
//            this.add(this.getRecastMenuBtn());
            this.add(this.getRefineryMenuBtn());
//            this.add(this.getQualityBtn());
//            this.add(this.getChooseWingLab());
//            this.add(this.getWingMinImg());
//            this.add(this.getLeftBtn());
//            this.add(this.getRightBtn());
//            this.add(this.getWingLevel());
//            this.add(this.getWingQuality());
//            this.add(this.getWingStarLevel());
            this.add(this.getExperience());
            this.add(this.getRuleWingScrollPane());
            this.add(this.getTextNumber());
            this.add(this.getCultivateBtn());
            this.add(this.getChooseGoodsImg());
            this.getNowAttributeLab();
            this.getWingNextPageBtn();
            this.getWingLastPageBtn();
            this.getGoodsLab();
            this.getAttributeLab();
            this.getUpStarMaterials();
//            this.getStarLab();
            this.getQualityLab();
            this.getWingLab();
            this.getRecastAttrLab();
            this.getRecastNowAttribute();
            this.getRecastBtn();
            this.getRefineryBtn();
            this.getNumberLab();
            this.getQualityNowLab();
            //this.getQualityHint();
            this.getWingRefining();
            this.getWingRefiningType();
            this.getRefiningTitle();


        }

    }


    /**
     * 更换左侧面板标识
     */
    public void changLeftType(int type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            try {
            switch (type) {
                case 1:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K64.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K65.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K67.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K69.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K55.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K71.png"));
                    break;
                case 2:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K63.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K66.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K67.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K69.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K55.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K71.png"));
                    break;
                case 3:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K63.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K65.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K68.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K69.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K55.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K71.png"));
                    break;
                case 4:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K63.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K65.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K67.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K70.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K55.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K71.png"));
                    break;
                case 5:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K63.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K65.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K67.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K69.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/lh2-1.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/lh1.png"));
                    break;
                case 6:
                    getWingMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K63.png"));
                    getUpgradeBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K65.png"));
                    getAmtyuranusBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K67.png"));
                    getQualityBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/K69.png"));
                    getRecastMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/lh2.png"));
                    getRefineryMenuBtn().setIcons(CutButtonImage.cuts("inkImg/newbutton/lh1-1.png"));
              }
            } catch (Exception e) {
                e.printStackTrace();
            }

        } else {
            try {
                switch (type) {
                    case 1:
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_未选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_未选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_未选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_重铸_未选中_w80,h120.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_炼化_未选中_w80,h120.png"));
                        break;
                    case 2:
                        getWingMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_翅膀_未选中_w80,h120.png"));
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_未选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_未选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_重铸_未选中_w80,h120.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_炼化_未选中_w80,h120.png"));
                        break;
                    case 3:
                        getWingMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_翅膀_未选中_w80,h120.png"));
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_未选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_未选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_重铸_未选中_w80,h120.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_炼化_未选中_w80,h120.png"));
                        break;
                    case 4:
                        getWingMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_翅膀_未选中_w80,h120.png"));
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_未选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_未选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_重铸_未选中_w80,h120.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_炼化_未选中_w80,h120.png"));
                        break;
                    case 5:
                        getWingMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_翅膀_未选中_w80,h120.png"));
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_未选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_未选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_未选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/mhlh2.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/hmlh-1.png"));
                        break;
                    case 6:
                        getWingMenuBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_翅膀_未选中_w80,h120.png"));
                        getUpgradeBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升级_未选中_w80,h120.png"));
                        getAmtyuranusBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_升星_未选中_w80,h120.png"));
                        getQualityBtn().setIcons(CutButtonImage.cuts("img/wing/一级选项卡_品质_未选中_w80,h120.png"));
                        getRecastMenuBtn().setIcons(CutButtonImage.cuts("img/wing/mhlh-2.png"));
                        getRefineryMenuBtn().setIcons(CutButtonImage.cuts("img/wing/hmlh1.png"));
                }
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        if (type == -1) {
            if (leftType == -1) {
                type = 1;
            } else {
                return;
            }
        }
        leftType = type;
        switch (leftType) {
            case 1:
                changRightType(5);
                break;
            case 2:
                changRightType(2);
                break;
            case 3:
                changRightType(3);
                break;
            case 4:
                changRightType(4);
                break;
            case 5:
                changRightType(6);
                break;
            case 6://炼化面板
                changRightType(7);
                break;
            default:
                break;
        }
    }

    /**
     * 更换右侧面板标识
     */
    public void changRightType(int type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type == rightType) {
                if (type == 2 && rightType == 2) {

                } else if (type == 3 && rightType == 3) {
                    getWingAttribute(1);
                } else if (type == 4 && rightType == 4) {
                    getGoodsConsumeNumber();
                    getWingAttribute(2);
                } else if (type == 5 && rightType == 5) {

                } else if (type == 6 && rightType == 6) {
                    getRefiningAttr(rightType);
                    refreshwingRefiningLab();
                } else if (type == 7 && rightType == 7) {
                    getRefiningAttr(rightType);
                    refreshwingRefiningLab();
                }
                return;
            }
            rightType = type;
            switch (rightType) {
                // case 1:
                // iconBackRight =
                // CutButtonImage.getImage("img/wing/翅膀_升级_属性框_w278,h431.png", 278,
                // 431);
                // goodsCultivateView(false);
                // upSatrView(false);
                // wingViewControl(false);
                // qualityViewControl(false);
                // recastViewControl(false);
                // refineryViewControl(false);
                // initView(true);
                // break;
                case 2:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B274.png", -1, -1);
                    // initView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    goodsCultivateView(true);
                    break;
                case 3:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B275.png", -1, -1);
                    // initView(false);
                    goodsCultivateView(false);
                    wingViewControl(false);
                    qualityViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    upSatrView(true);
                    break;
                case 4:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B276.png", -1, -1);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    qualityViewControl(true);
                    break;
                case 5:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B278.png", -1, -1);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(true);
                    break;
                case 6:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B278.png", -1, -1);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(true);
                    break;
                case 7:
                    iconBackRight = CutButtonImage.getImage("inkImg/newbackground/B278.png", -1, -1);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(true);
                default:
                    break;
            }
        } else {
            if (type == rightType) {
                if (type == 2 && rightType == 2) {

                } else if (type == 3 && rightType == 3) {
                    getWingAttribute(1);
                } else if (type == 4 && rightType == 4) {
                    getGoodsConsumeNumber();
                    getWingAttribute(2);
                } else if (type == 5 && rightType == 5) {

                } else if (type == 6 && rightType == 6) {
                    getRefiningAttr(rightType);
                    refreshwingRefiningLab();
                } else if (type == 7 && rightType == 7) {
                    getRefiningAttr(rightType);
                    refreshwingRefiningLab();
                }
                return;
            }
            rightType = type;
            switch (rightType) {
                // case 1:
                // iconBackRight =
                // CutButtonImage.getImage("img/wing/翅膀_升级_属性框_w278,h431.png", 278,
                // 431);
                // goodsCultivateView(false);
                // upSatrView(false);
                // wingViewControl(false);
                // qualityViewControl(false);
                // recastViewControl(false);
                // refineryViewControl(false);
                // initView(true);
                // break;
                case 2:
                    iconBackRight = CutButtonImage.getImage("img/wing/翅膀_升级_物品培养_w278,h431.png", 278, 431);
                    // initView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    goodsCultivateView(true);
                    break;
                case 3:
                    iconBackRight = CutButtonImage.getImage("img/wing/翅膀_升级_属性_w278,h431.png", 278, 431);
                    // initView(false);
                    goodsCultivateView(false);
                    wingViewControl(false);
                    qualityViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    upSatrView(true);
                    break;
                case 4:
                    iconBackRight = CutButtonImage.getImage("img/wing/翅膀_品质_属性_w278,h431.png", 278, 431);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    qualityViewControl(true);
                    break;
                case 5:
                    iconBackRight = CutButtonImage.getImage("img/wing/翅膀_翅膀_w278,h431.png", 278, 431);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(false);
                    wingViewControl(true);
                    break;
                case 6:
                case 7:
                    iconBackRight = CutButtonImage.getImage("img/wing/翅膀_炼化_w278,h431.png", 278, 431);
                    // initView(false);
                    goodsCultivateView(false);
                    upSatrView(false);
                    qualityViewControl(false);
                    wingViewControl(false);
                    recastViewControl(false);
                    refineryViewControl(true);
                default:
                    break;
            }
        }
    }

    /**
     * 规则说明切换
     */
    public void changeRule() {
        wingRefiningType = new boolean[4];
        for (int i = 0; i < wingRefiningType.length; i++) {
            wingRefining[i].setIcon(null);
            wingRefiningType[i] = false;
        }
        RichLabel view = (RichLabel) ruleWingScrollPane.getViewport().getView();
        StringBuffer buffer = new StringBuffer();
        if (rightType == 2) {// 升级
            buffer.append("#Y翅膀升级培养功能玩法明细#r1，#Y翅膀经验影响翅膀加成属性值，等级越高属性增加越多。#r2，#R全局所有物品#Y均可作为培养材料，每次培养费用为1000万。#r3，#R普通物品培养经验为1点，#Y稀有掉落，商城内物资培养值2-10点浮动。#r4，#R唯一性翅膀培养材料，#Y新副本掉落，商城购买，及向玩家手里收购。#r");
        } else if (rightType == 3) {// 升星
            buffer.append("#Y翅膀升星玩法说明#r1，#G使用唯一材料#R秘羽灵石#Y对翅膀进行升星#r2，#R秘羽灵石#Y共分5级，每个等级对应3颗星级，例（1-3级需要1级秘羽灵石，4-6需要2级，每三级递增一个秘羽灵石）。#r3，#R秘羽灵石#Y合成公式，打开套装面板，点击炼化配饰，#G每4个相同等级秘羽灵石，合成下一个等级得秘羽灵石。");
        } else if (rightType == 4) {// 品质
            buffer.append("#Y品质提升玩法说明#r1，#Y使用唯一材料#R翅膀品质石#Y对翅膀进行品质提升#r2，#Y每个品质对应不同外观，品质越高翅膀外观越炫酷，#R增加四围成长越高，（初始翅膀四围成长为1）。#r3，#Y每个级别提升品质得概率均为20%，翅膀品质提升必须满足当前星级已满，品质提后成功后星级清空。#r4，#Y翅膀提升品质时，不考虑等级，不管等级多少都可以对翅膀进行品质提醒，前提是要满星噢！");
        } else if (rightType == 5) {// 翅膀
            buffer.append("#Y翅膀功能简介 #r1，#Y翅膀等级，#G（全局物品可以培养）。#r2，#Y翅膀升星，#G（提升当前属性成长，提升品质前置需求）。#r3，#Y翅膀品质，#G（提升增加四围对人物得成长比）（例1点成长为1点属性）。#r4，#Y翅膀重铸，#G（对应当前属性进行重铸，获得新得属性分配）#r5，#Y翅膀炼化，#G（对应当前翅膀，进行翅膀炼化，炼化数值参照炼器数值）#r");
        } else if (rightType == 6) {// 重铸
            buffer.append("#W靓号炼化玩法说明#r#R1.#W对当前靓号进行炼化，增加靓号属性；#r#R2.#W使用#R仙器精华#W通过副本掉落、商城购买，每次使用消耗#R10个#W仙器精华。");
        } else if (rightType == 7) {// 炼化
            buffer.append("#W靓号炼化玩法说明#r#R1.#W对当前靓号进行炼化，增加靓号属性；#r#R2.#W使用#R仙器精华#W通过副本掉落、商城购买，每次使用消耗#R10个#W仙器精华。");
        }
        view = new RichLabel(buffer.toString(), UIUtils.TEXT_FONT2);
        Dimension d = view.computeSize(130);
        view.setSize(d);
        view.setPreferredSize(d);
        ruleWingScrollPane.setViewportView(view);
    }

    // 翅膀面板右侧控件
    public void wingViewControl(boolean type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                ruleWingScrollPane.setBounds(354, 378, 279, 125);
                pageNumber = 1;
                wingNextPageBtn.setBounds(614, 283 + 25, 18, 18);
                wingLastPageBtn.setBounds(614, 283, 18, 18);
                chosegoods = null;
                chooseGoodsImg.setIcon(null);
                changeRule();
            }
            for (int i = 0; i < wingLab.length; i++) {
                wingLab[i].setVisible(type);
            }
            wingLastPageBtn.setVisible(type);
            wingNextPageBtn.setVisible(type);
            ruleWingScrollPane.setVisible(type);
        } else {
            if (type) {
                this.ruleWingScrollPane.setBounds(253, 387, 274, 125);
                this.pageNumber = 1;
                this.wingNextPageBtn.setBounds(520, 308, 19, 20);
                this.wingLastPageBtn.setBounds(520, 283, 19, 20);
                this.chosegoods = null;
                this.chooseGoodsImg.setIcon(null);
                this.changeRule();
            }
            int i = 0;
            while (i < this.wingLab.length) {
                this.wingLab[i].setVisible(type);
                ++i;
            }
            this.wingLastPageBtn.setVisible(type);
            this.wingNextPageBtn.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
        }
    }

    // 升级右侧面板控件展示与否
    public void goodsCultivateView(boolean type) {

        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                chooseGoodsImg.setBounds(368, 290, 50, 50);
                textNumber.setBounds(520, 327, textNumber.getWidth(), textNumber.getHeight());
                cultivateBtn.setText("培养");
                cultivateBtn.setBounds(580, 325, cultivateBtn.getWidth(), cultivateBtn.getHeight());
                ruleWingScrollPane.setBounds(354, 378, 279, 125);
                pageNumber = 1;
                wingNextPageBtn.setBounds(614, 243, 18, 18);
                wingLastPageBtn.setBounds(614, 210, 18, 18);
                chosegoods = null;
                chooseGoodsImg.setIcon(null);
                money = new BigDecimal(0);
                changeRule();
            }
            this.textNumber.setText("0");
            this.wingNextPageBtn.setVisible(type);
            this.wingLastPageBtn.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
            this.cultivateBtn.setVisible(type);
            this.textNumber.setVisible(type);
            int i = 0;
            while (i < this.goodsLab.length) {
                this.goodsLab[i].setVisible(type);
                ++i;
            }
        } else {
            if (type) {
                this.chooseGoodsImg.setBounds(253, 275, 58, 56);
                this.textNumber.setBounds(this.textNumber.getX(), 315, this.textNumber.getWidth(), this.textNumber.getHeight());
                this.cultivateBtn.setBounds(this.cultivateBtn.getX(), 315, this.cultivateBtn.getWidth(), this.cultivateBtn.getHeight());
                this.ruleWingScrollPane.setBounds(253, 104, 274, 160);
                this.pageNumber = 1;
                this.wingNextPageBtn.setBounds(508, 493, 19, 20);
                this.wingLastPageBtn.setBounds(508, 460, 19, 20);
                this.chosegoods = null;
                this.chooseGoodsImg.setIcon(null);
                this.money = new BigDecimal(0);
                this.changeRule();
            }
        }

        this.textNumber.setText("0");
        this.wingNextPageBtn.setVisible(type);
        this.wingLastPageBtn.setVisible(type);
        this.ruleWingScrollPane.setVisible(type);
        this.chooseGoodsImg.setVisible(type);
        this.cultivateBtn.setVisible(type);
        this.textNumber.setVisible(type);
        int i = 0;
        while (i < this.goodsLab.length) {
            this.goodsLab[i].setVisible(type);
            ++i;
        }
    }

    // 升星面板控件展示与否
    public void upSatrView(boolean type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                for (int i = 0; i < attributeLab.length; i++) {
                    attributeLab[i].setBounds(399 + i % 2 * 156, 113 + i / 2 * 22, 64, 14);
                }
                for (int i = 0; i < upStarMaterials.length; i++) {
                    upStarMaterials[i].setBounds(357 + i % 5 * 54, 317, 50, 50);
                }
                chooseGoodsImg.setBounds(365, 225, 58, 56);
                numberLab.setText("0");
                numberLab.setBounds(520, 261, numberLab.getWidth(), numberLab.getHeight());
                cultivateBtn.setText("培养");
                cultivateBtn.setBounds(580, 261, cultivateBtn.getWidth(), cultivateBtn.getHeight());
                ruleWingScrollPane.setBounds(352, 396, 280, 107);
                money = new BigDecimal(0);
                chooseGoodsImg.setIcon(null);
                chosegoods = null;
                getWingAttribute(1);
                changeRule();
            }
            money = new BigDecimal(0);
            chooseGoodsImg.setVisible(type);
            cultivateBtn.setVisible(type);
            numberLab.setVisible(type);
            ruleWingScrollPane.setVisible(type);
            for (int i = 0; i < attributeLab.length; i++) {
                attributeLab[i].setVisible(type);
            }
            for (int i = 0; i < upStarMaterials.length; i++) {
                upStarMaterials[i].setVisible(type);
            }
        } else {
            int i = 0;
            while (i < this.attributeLab.length) {
                this.attributeLab[i].setVisible(type);
                if (type) {
                    this.attributeLab[i].setBounds(275 + i % 2 * 156 + 21, 45 + i / 2 * 22 + 70, 64, 14);
                }
                ++i;
            }
            i = 0;
            while (i < this.upStarMaterials.length) {
                this.upStarMaterials[i].setVisible(type);
                if (type) {
                    this.upStarMaterials[i].setBounds(232 + i % 5 * 51 + 21, 308, 50, 50);
                }
                ++i;
            }
            this.ruleWingScrollPane.setVisible(type);
            if (type) {
                this.chooseGoodsImg.setBounds(253, 221, 58, 56);
                this.numberLab.setBounds(412, 260, this.numberLab.getWidth(), this.numberLab.getHeight());
                this.cultivateBtn.setBounds(this.cultivateBtn.getX(), 261, this.cultivateBtn.getWidth(), this.cultivateBtn.getHeight());
                this.ruleWingScrollPane.setBounds(253, 387, 274, 125);
                this.numberLab.setText("0");
                this.money = new BigDecimal(0);
                this.chooseGoodsImg.setIcon(null);
                this.chosegoods = null;
                this.getWingAttribute(1);
                this.changeRule();
            }
            this.money = new BigDecimal(0);
            this.chooseGoodsImg.setVisible(type);
            this.cultivateBtn.setVisible(type);
            this.numberLab.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
        }
    }

    // 品质面板右侧控件展示
    public void qualityViewControl(boolean type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                for (int i = 0; i < attributeLab.length; i++) {
                    attributeLab[i].setBounds(399 + i % 2 * 156, 174 + i / 2 * 22, 64, 14);
                }
                for (int i = 0; i < qualityLab.length; i++) {
                    qualityLab[i].setBounds(383 + i * 156, 111, 55, 53);
                }
                chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("cbpzs", 58, 56));
                chooseGoodsImg.setBounds(365, 287, 58, 56);
                numberLab.setText("0");
                numberLab.setBounds(520, 325, numberLab.getWidth(), numberLab.getHeight());
                cultivateBtn.setText("培养");
                cultivateBtn.setBounds(580, 324, cultivateBtn.getWidth(), cultivateBtn.getHeight());
                ruleWingScrollPane.setBounds(351, 396, 282, 107);
                money = new BigDecimal(0);
                chosegoods = null;
                getGoodsConsumeNumber();
                getWingAttribute(2);
                changeRule();
            }
            for (int i = 0; i < attributeLab.length; i++) {
                attributeLab[i].setVisible(type);
            }
            for (int i = 0; i < qualityLab.length; i++) {
                qualityLab[i].setVisible(type);
            }
            for (int i = 0; i < qualityNowLab.length; i++) {
                qualityNowLab[i].setVisible(type);
            }
            chooseGoodsImg.setVisible(type);
            cultivateBtn.setVisible(type);
            numberLab.setVisible(type);
            ruleWingScrollPane.setVisible(type);
        } else {
            if (type) {
                this.chooseGoodsImg.setBounds(253, 284, 58, 56);
                this.numberLab.setBounds(412, 323, this.numberLab.getWidth(), this.numberLab.getHeight());
                this.cultivateBtn.setBounds(this.cultivateBtn.getX(), 324, this.cultivateBtn.getWidth(), this.cultivateBtn.getHeight());
                this.ruleWingScrollPane.setBounds(253, 387, 274, 125);
                this.money = new BigDecimal(0);
                this.chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("cbpzs", 58, 56));
                this.chosegoods = null;
                this.numberLab.setText("0");
                this.getGoodsConsumeNumber();
                this.getWingAttribute(2);
                this.changeRule();
            }
            int i = 0;
            while (i < this.attributeLab.length) {
                this.attributeLab[i].setVisible(type);
                if (type) {
                    this.attributeLab[i].setBounds(275 + i % 2 * 156 + 21, 180 + i / 2 * 22, 64, 14);
                }
                ++i;
            }
            i = 0;
            while (i < this.qualityLab.length) {
                this.qualityLab[i].setVisible(type);
                if (type) {
                    this.qualityLab[i].setBounds(262 + i * 156, 119, 55, 53);
                }
                ++i;
            }
            i = 0;
            while (i < this.qualityNowLab.length) {
                this.qualityNowLab[i].setVisible(type);
                ++i;
            }
            //this.qualityHint.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
            this.cultivateBtn.setVisible(type);
            this.numberLab.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
        }
    }

    // 拆分获取翅膀value获取数据
    public String getGoodsValue(String[] values, String type) {
        for (int i = 0; i < values.length; i++) {
            if (values[i].startsWith(type)) {
                return values[i].split("=")[1];
            }
        }
        return null;
    }

    // 重铸面板右侧控件
    public void recastViewControl(boolean type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                for (int i = 0; i < recastAttrLab.length; i++) {
                    recastAttrLab[i].setBounds(460, 173 + i * 22, 64, 14);
                }
                ruleWingScrollPane.setBounds(351, 396, 281, 107);
                chooseGoodsImg.setBounds(367, 295, 49, 49);
                chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("cbczs", 49, 49));
                money = new BigDecimal(10000000);
                qualityLab[0].setBounds(459, 112, 55, 53);
                changeRule();
                getWingRecastAttribute();
            }
            for (int i = 0; i < recastAttrLab.length; i++) {
                recastAttrLab[i].setVisible(type);
            }
            this.qualityLab[0].setVisible(type);
            this.recastBtn.setVisible(type);
            this.recastNowAttribute.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
        } else {
            if (type) {
                this.ruleWingScrollPane.setBounds(253, 339, 274, 173);
                this.chooseGoodsImg.setBounds(253, 229, 55, 53);
                this.chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("cbczs", 58, 56));
                this.money = new BigDecimal(10000000);
                this.qualityLab[0].setBounds(262, 121, 55, 53);
                this.changeRule();
                this.getWingRecastAttribute();
            }
            int i = 0;
            while (i < this.recastAttrLab.length) {
                this.recastAttrLab[i].setVisible(type);
                if (type) {
                    this.recastAttrLab[i].setBounds(368, 121 + i * 22, 64, 14);
                }
                ++i;
            }
            this.qualityLab[0].setVisible(type);
            this.recastBtn.setVisible(type);
            this.recastNowAttribute.setVisible(type);
            this.ruleWingScrollPane.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
        }
    }

    // 炼化面板右侧控件
    public void refineryViewControl(boolean type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (type) {
                this.ruleWingScrollPane.setBounds(93, 358, 280, 146);
                this.numberLab.setBounds(255, 300, this.numberLab.getWidth(), this.numberLab.getHeight());
                this.money = new BigDecimal(10000000);
                this.numberLab.setText("10");
                this.chooseGoodsImg.setBounds(110, 262, 49, 49);
                this.chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("9911", 49, 49));
                this.changeRule();
                this.getRefiningAttr(rightType);
                this.refreshwingRefiningLab();
            }
            for (int i = 0; i < nowAttributeLab.length; i++) {
                nowAttributeLab[i].setVisible(type);
            }
            for (int i = 0; i < wingRefining.length; i++) {
                wingRefining[i].setVisible(type);
            }
            this.ruleWingScrollPane.setVisible(type);
            this.refineryBtn.setVisible(type);
            this.numberLab.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
            this.refiningTitle.setVisible(type);
        } else {
            if (type) {
                this.ruleWingScrollPane.setBounds(105, 349, 270, 163);
                this.numberLab.setBounds(265, 301, this.numberLab.getWidth(), this.numberLab.getHeight());
                this.money = new BigDecimal(500000);
                this.numberLab.setText("10");
                this.chooseGoodsImg.setBounds(100, 262, 58, 56);
                this.chooseGoodsImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive("9911", 58, 56));
                this.changeRule();
                this.getRefiningAttr(rightType);
                this.refreshwingRefiningLab();
            }
            int i = 0;
            while (i < this.nowAttributeLab.length) {
                this.nowAttributeLab[i].setVisible(type);
                ++i;
            }
            this.ruleWingScrollPane.setVisible(type);
            this.refineryBtn.setVisible(type);
            this.numberLab.setVisible(type);
            this.chooseGoodsImg.setVisible(type);
            this.refiningTitle.setVisible(type);
        }
    }

    /**
     * 升星面板左侧控件展示与否
     */
    public void upStarViewControl(boolean type) {
        for (int i = 0; i < starLab.length; i++) {
            starLab[i].setVisible(type);
        }
    }

    /**
     * 界面的属性数据获取
     */
    public static int getUpStarData(String DataStr, int starLvl, String qualityAttr) {
        double parseDouble = Double.parseDouble(DataStr);
        if (qualityAttr == null) {
            return 0;
        }
        return (int) (parseDouble * (1 + starLvl * 0.1) * (1 + getQualityAttr(qualityAttr)));
    }

    // 获取品质对应的属性加成
    public static double getQualityAttr(String qualityAttr) {
        switch (qualityAttr) {
            case "把玩":
                return 0;
            case "贴身":
                return 0.2;
            case "珍藏":
                return 0.4;
            case "无价":
                return 0.8;
            case "传世":
                return 1.6;
            case "神迹":
                return 3.2;
            default:
                return -1;
        }
    }

    // 品质界面获取物品消耗的数量
    public void getGoodsConsumeNumber() {
        if (wingGoods == null) {
            return;
        }
        Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
        if (goodstable == null) {
            return;
        }
        String[] split = goodstable.getValue().split("\\|");
        String goodsQuality = getGoodsValue(split, "品质");
        switch (goodsQuality) {
            case "把玩":
                numberLab.setText("1");
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[1].setForeground(getQualityColor("贴身"));
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("贴身");
                break;
            case "贴身":
                numberLab.setText("2");
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[1].setForeground(getQualityColor("珍藏"));
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("珍藏");
                break;
            case "珍藏":
                numberLab.setText("4");
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[1].setForeground(getQualityColor("无价"));
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("无价");
                break;
            case "无价":
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[1].setForeground(getQualityColor("传世"));
                numberLab.setText("6");
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("传世");
                break;
            case "传世":
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[1].setForeground(getQualityColor("神迹"));
                numberLab.setText("10");
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("神迹");
                break;
            case "神迹":
                numberLab.setText("0");
                qualityNowLab[0].setForeground(getQualityColor(goodsQuality));
                qualityNowLab[0].setText(goodsQuality);
                qualityNowLab[1].setText("");
                break;
            default:
                break;
        }
        money = new BigDecimal(10000000);
    }

    /**
     * 获取下一个品质名称
     */
    public String getQualityName(String name) {
        switch (name) {
            case "把玩":
                return "贴身";
            case "贴身":
                return "珍藏";
            case "珍藏":
                return "无价";
            case "无价":
                return "传世";
            case "传世":
                return "神迹";
            case "神迹":
                return null;
        }
        return null;

    }

    /**
     * 根据品质获取对应翅膀
     */
    public String getWingSkin(String name) {
        if (wingGoods == null) {
            return null;
        }
        Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
        if (goodstable == null) {
            return null;
        }
        String substring = goodstable.getSkin().substring(0, goodstable.getSkin().length() - 1);
        switch (name) {
            case "把玩":
                return substring + 1;
            case "贴身":
                return substring + 2;
            case "珍藏":
                return substring + 3;
            case "无价":
                return substring + 4;
            case "传世":
                return substring + 5;
            case "神迹":
                return substring + 6;
        }
        return null;
    }

    // 经验转换为等级
    public static int getWingLevel(String exp) {
        int parseInt = Integer.parseInt(exp);
        int i = 1;
        while (true) {
            if (parseInt < i * i * 100) {
                return i - 1;
            }
            i++;
        }
    }

    // 当前等级总经验
    public static BigDecimal getLevelNowExp(int level) {
        return new BigDecimal(level * level * 100);
    }

    // 当前等级当前经验
    public static BigDecimal getLevelLastExp(String exp) {
        return new BigDecimal(exp).subtract(getLevelNowExp(getWingLevel(exp)));
    }

    // 升星界面获取当前翅膀的属性 1是升星 2是品质
    public void getWingAttribute(int type) {
        if (wingGoods == null) {
            return;
        }
        Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
        if (goodstable == null) {
            return;
        }
        String[] split = goodstable.getValue().split("\\|");
        int goodsStar = Integer.parseInt(getGoodsValue(split, "星级"));
        int goodsStarUp = 0;
        String goodsQualityUp = null;
        String goodsQuality = getGoodsValue(split, "品质");
        if (type == 1) {
            goodsStarUp = goodsStar + 1;
            goodsQualityUp = goodsQuality;
        } else if (type == 2) {
            goodsStarUp = goodsStar;
            goodsQualityUp = getQualityName(goodsQuality);
            if (getWingSkin(goodsQuality) != null)
                qualityLab[0].setIcon(GoodsListFromServerUntil.imgpathAdaptive(getWingSkin(goodsQuality), 55, 53));
            if (goodsQualityUp != null && getWingSkin(goodsQualityUp) != null) {
                qualityLab[1].setIcon(GoodsListFromServerUntil.imgpathAdaptive(getWingSkin(goodsQualityUp), 55, 53));
            } else {
                qualityLab[1].setIcon(null);
            }
        }
        String intelligence = getGoodsValue(split, "灵性");
        String bone = getGoodsValue(split, "根骨");
        String strength = getGoodsValue(split, "力量");
        String agility = getGoodsValue(split, "敏捷");
        attributeLab[2].setText(intelligence == null ? "0" : "" + getUpStarData(intelligence, goodsStar, goodsQuality));
        attributeLab[0].setText(bone == null ? "0" : "" + getUpStarData(bone, goodsStar, goodsQuality));
        attributeLab[4].setText(strength == null ? "0" : "" + getUpStarData(strength, goodsStar, goodsQuality));
        attributeLab[6].setText(agility == null ? "0" : "" + getUpStarData(agility, goodsStar, goodsQuality));
        if (goodsStarUp > 15 || goodsQualityUp == null) {
            attributeLab[1].setText("");
            attributeLab[3].setText("");
            attributeLab[5].setText("");
            attributeLab[7].setText("");
        } else {
            attributeLab[3].setText(intelligence == null ? "0" : "" + getUpStarData(intelligence, goodsStarUp, goodsQualityUp));
            attributeLab[1].setText(bone == null ? "0" : "" + getUpStarData(bone, goodsStarUp, goodsQualityUp));
            attributeLab[5].setText(strength == null ? "0" : "" + getUpStarData(strength, goodsStarUp, goodsQualityUp));
            attributeLab[7].setText(agility == null ? "0" : "" + getUpStarData(agility, goodsStarUp, goodsQualityUp));
        }
    }

    // 重铸界面获取当前翅膀的属性
    public void getWingRecastAttribute() {
        if (wingGoods == null) {
            return;
        }
        Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
        if (goodstable == null) {
            return;
        }
        String[] split = goodstable.getValue().split("\\|");
        String intelligence = getGoodsValue(split, "灵性");
        int goodsStar = Integer.parseInt(getGoodsValue(split, "星级"));
        String goodsQuality = getGoodsValue(split, "品质");
        qualityLab[0].setIcon(GoodsListFromServerUntil.imgpathAdaptive(getWingSkin(goodsQuality), 55, 53));
        recastAttrLab[1].setText(intelligence == null ? "0" : "" + getUpStarData(intelligence, goodsStar, goodsQuality));
        String bone = getGoodsValue(split, "根骨");
        recastAttrLab[0].setText(bone == null ? "0" : "" + getUpStarData(bone, goodsStar, goodsQuality));
        String strength = getGoodsValue(split, "力量");
        recastAttrLab[2].setText(strength == null ? "0" : "" + getUpStarData(strength, goodsStar, goodsQuality));
        String agility = getGoodsValue(split, "敏捷");
        recastAttrLab[3].setText(agility == null ? "0" : "" + getUpStarData(agility, goodsStar, goodsQuality));
    }

    // 获取品质对应的颜色
    public Color getQualityColor(String qualityName) {
        switch (qualityName) {
            case "把玩":
                return UIUtils.COLOR_PLAY;
            case "贴身":
                return UIUtils.COLOR_PERSONAL;
            case "珍藏":
                return UIUtils.COLOR_TREASURE;
            case "无价":
                return UIUtils.COLOR_NONVALENT;
            case "传世":
                return UIUtils.COLOR_CHENS;
            case "神迹":
                return UIUtils.COLOR_SIGN;
            default:
                return null;
        }
    }

    // 获取品质对应的颜色
    public static String getQualityColorOx(String qualityName) {
        switch (qualityName) {
            case "把玩":
                return "#c29BF6B";
            case "贴身":
                return "#c01FBF9";
            case "珍藏":
                return "#cEFEE0C";
            case "无价":
                return "#cDB0ACD";
            case "传世":
                return "#cF35E01";
            case "神迹":
                return "#cFB0001";
            default:
                return null;
        }
    }

    // //画出当前选择的翅膀
    public void changeChooseWingGoods(Goodstable goodstable, int type) {
        if (MyIsif.getStyle().equals("水墨UI")) {
//            wingGoods = goodstable.getRgid();
            changRightType(rightType);
            wingGoodsType = type;
            if (wingGoods == null) {
                return;
            }
            // MouseListener[] mouseListeners = wingMinImg.getMouseListeners();
            // LHChooseGoodsMouseListener mouse = (LHChooseGoodsMouseListener)
            // mouseListeners[0];
            wingMinImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 60, 60));
            // wingMaxImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(),
            // 120, 120));
            // 品质=xxx|星级=xxx|经验=xxx|颜色=xxx|...........................
            String[] values = goodstable.getValue().split("\\|");
            for (int i = 0; i < values.length; i++) {
                String[] split = values[i].split("=");
                switch (split[0]) {
                    case "品质":
                        wingQuality.setForeground(getQualityColor(split[1]));
                        wingQuality.setText(split[0] + ":" + split[1]);
                        break;
                    case "星级":
                        wingStarLevel.setText(split[0] + ":" + split[1] + "/15");
                        for (int j = 0; j < starLab.length; j++) {
                            if (j <= (Integer.parseInt(split[1]) - 1)) {
                                starLab[j].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏w28px,h28px.png", 20, 20));
                            } else {
                                starLab[j].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏(未)w28px,h28px.png", 20, 20));
                            }
                        }
                        break;
                    case "经验":
                        wingLevel.setText("等级:" + getWingLevel(split[1]));
                        int divide = getLevelLastExp(split[1])
                                .multiply(new BigDecimal(106))
                                .divide(getLevelNowExp(getWingLevel(split[1]) + 1).subtract(getLevelNowExp(getWingLevel(split[1]))), 2,
                                        BigDecimal.ROUND_HALF_UP).intValue();
                        experience.setIcon(CutButtonImage.getImage("inkImg/background/S22.png", divide == 0 ? 1 : divide, 10));

                        break;
                    // case "颜色":
                    ///
                    // break;
                    default:
                        break;
                }
            }
        } else {
//            wingGoods = goodstable.getRgid();
            changRightType(rightType);
            wingGoodsType = type;
            if (wingGoods == null) {
                return;
            }
            // MouseListener[] mouseListeners = wingMinImg.getMouseListeners();
            // LHChooseGoodsMouseListener mouse = (LHChooseGoodsMouseListener)
            // mouseListeners[0];
            wingMinImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(), 60, 60));
            // wingMaxImg.setIcon(GoodsListFromServerUntil.imgpathAdaptive(goodstable.getSkin(),
            // 120, 120));
            // 品质=xxx|星级=xxx|经验=xxx|颜色=xxx|...........................
            String[] values = goodstable.getValue().split("\\|");
            for (int i = 0; i < values.length; i++) {
                String[] split = values[i].split("=");
                switch (split[0]) {
                    case "品质":
                        wingQuality.setForeground(getQualityColor(split[1]));
                        wingQuality.setText(split[0] + ":" + split[1]);
                        break;
                    case "星级":
                        wingStarLevel.setText(split[0] + ":" + split[1] + "/15");
                        for (int j = 0; j < starLab.length; j++) {
                            if (j <= (Integer.parseInt(split[1]) - 1)) {
                                starLab[j].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏w28px,h28px.png", 20, 20));
                            } else {
                                starLab[j].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏(未)w28px,h28px.png", 20, 20));
                            }
                        }
                        break;
                    case "经验":
                        wingLevel.setText("等级:" + getWingLevel(split[1]));
                        int divide = getLevelLastExp(split[1])
                                .multiply(new BigDecimal(106))
                                .divide(getLevelNowExp(getWingLevel(split[1]) + 1).subtract(getLevelNowExp(getWingLevel(split[1]))), 2,
                                        BigDecimal.ROUND_HALF_UP).intValue();
                        experience.setIcon(CutButtonImage.getImage("img/wing/翅膀_经验条_w106,h10.png", divide == 0 ? 1 : divide, 10));

                        break;
                    // case "颜色":
                    ///
                    // break;
                    default:
                        break;
                }
            }
        }
    }

    // 获取当前炼化的属性
    public void getRefiningAttr(int rightType) {
        for (int i = 0; i < nowAttributeLab.length; i += 2) {

            nowAttributeLab[i].setText("");
            nowAttributeLab[i + 1].setText("");
        }
        if (StringUtils.isBlank(RoleData.getRoleData().getLoginResult().getLianghaoValue())) return;
        String v = "";

        if (RoleData.getRoleData().getLoginResult().getLianghaoValue().contains("@")) {
            String[] split1 = RoleData.getRoleData().getLoginResult().getLianghaoValue().split("@");

            if (rightType == 6 && split1.length >= 3) {
                v = split1[2];
            } else if (rightType == 7 && split1.length >= 2) {
                v = split1[1];
            } else if (rightType == 8 && split1.length > 3) {
                v = split1[3];
            } else if (rightType == 9 && split1.length > 4) {
                v = split1[4];
            }
//            int i = rightType - 6;
//            int i1 = split1.length - 1;
//            if(i1<i){
//                v ="";
//            }else{
//                v = split1[i];
//            }
//            if (split1.length == 2&& rightType == 6) {
//                v =  "";
//            }else if(split1.length >=3 && rightType == 8){
//                v =  "";
//            }else if(split1.length >=3){
//
//            }
//            if (rightType== 8) {
//                v = rightType == 7 ? split1[1] : split1[2];
//            }else if (split1.length == 3) {
//                v = rightType == 7 ? split1[1] : split1[2];
//            }else if (rightType == 7) {
//                v = split1[0];
//            }
        } else {
            v = RoleData.getRoleData().getLoginResult().getLianghaoValue();
        }

        // 炼化属性&xxx=xxx&xxx=xxx&特技=技能id=技能id
        String value = AccessSuitMsgUntil.getExtra(v, "炼化属性");
        if (value == null || value.equals("")) {
            return;
        }
        String[] split = value.split("&");

        int num = 1;
        for (int i = 0; i < nowAttributeLab.length; i += 2) {
            if ((split.length - 1) >= num) {
                if (!split[num].startsWith("特技")) {
                    nowAttributeLab[i].setText(split[num].split("=")[0]);
                    nowAttributeLab[i + 1].setText(split[num].split("=")[1]);
                    num++;
                }
            } else {
                nowAttributeLab[i].setText("");
                nowAttributeLab[i + 1].setText("");
            }
        }
    }

    public void drawChooseImg(int num, Graphics g, int x, int y) {
        for (int i = 0; i < num; ++i) {
            g.drawImage(CutButtonImage.getImage("img/xy2uiimg/待选.png", 15, 15).getImage(), x, y + i * 27, 15, 15, (ImageObserver) null);
        }

    }

    /**
     * 获取锁定值
     */
    public int getlock() {
        int lock = 0;
        int size = 0;
        for (int i = 0; i < wingRefiningType.length; i++) {
            if (wingRefiningType[i]) {
                lock += Math.pow(10, i);
                size++;
            }
        }
        return lock * 10 + size;
    }

    // 炼化花费金额
    public int getRefiningMoney(int num) {
        switch (num) {
            case 1:
                return 1000;
            case 2:
                return 2000;
            case 3:
                return 3000;
            default:
                return 0;
        }
    }

    /**
     * 炼化刷新勾选框
     */
    public void refreshwingRefiningLab() {
        for (int i = 0; i < wingRefiningType.length; i++) {
            if (wingRefiningType[i]) {
                for (int j = 0; j < i; j++) {
                    if (!wingRefiningType[j]) {
                        wingRefiningType[j] = wingRefiningType[i];
                        wingRefining[j].setIcon(CutButtonImage.getImage("img/xy2uiimg/showjadesuit.png", 15, 15));
                        wingRefining[i].setIcon(null);
                        wingRefiningType[i] = false;
                    }
                }
            }
        }
    }

    private ImageIcon iconBack;
    private ImageIcon iconBackLeft;
    private int leftType = -1; // 左侧面板更换标识 2升级面板
    private ImageIcon iconBackRight;
    private int rightType = 1; // 右边面板展示标识

    @Override
    protected void paintComponent(Graphics g) {
        super.paintComponent(g);
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (iconBack == null) {
                iconBack = new ImageIcon("inkImg/newbackground/lhlh.png");
            }
            g.drawImage(iconBack.getImage(), 0, 0, 444, 538, this);
//            if (iconBackLeft == null) {
//                iconBackLeft = new ImageIcon("inkImg/newbackground/B272.png");
//            }
//            g.drawImage(iconBackLeft.getImage(), 57, 85, iconBackLeft.getIconWidth(), iconBackLeft.getIconHeight(), this);
            if (iconBackRight != null) {
                g.drawImage(iconBackRight.getImage(), 90, 85, 281, 420, this);
            }

            if (rightType == 7 || rightType == 6) {
                Util.drawMoney(g, 255, 271);
                if (money != null)
                    Util.drawPrice(g, money, 255, 291);
                GoodsListFromServerUntil.getRefiningGoods(g, this, 105, 262);
            }

            if (wingGoods != null) {
                Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
                if (goodstable == null) {
                    return;
                }
                Sprite sprite = SpriteFactory.Prepare(GetTcpPath.getMouseTcp("tx/" + goodstable.getSkin() + "1"));
                if (sprite != null) {
                    sprite.updateToTime(ImageMixDeal.userimg.getTime(), 4);
                    sprite.draw(g, 50 + 21 + 60, 180 + 70 + 140);
                }
            }
        } else {
            if (iconBack == null) {
                iconBack = new ImageIcon("img/wing/lhlhh.png");
            }
            g.drawImage(iconBack.getImage(), 0, 0, 444, 537, this);
//            if (iconBackLeft == null) {
//                iconBackLeft = CutButtonImage.getImage("img/wing/翅膀_品质&升星_展示框w218,h429.png", 218, 429);
//            }
//            g.drawImage(iconBackLeft.getImage(), 23, 85, iconBackLeft.getIconWidth(), iconBackLeft.getIconHeight(), this);
            if (iconBackRight != null) {
                g.drawImage(iconBackRight.getImage(), 100, 85, 278, 431, this);
            }

            if (rightType == 7|| rightType == 6) {
                Util.drawMoney(g, 265, 274);
                if (money != null)
                    Util.drawPrice(g, money, 265, 294);
                GoodsListFromServerUntil.getRefiningGoods(g, this, 100, 262);
                this.drawChooseImg(4, g, 230, 120);
            }

            if (wingGoods != null) {
                Goodstable goodstable = GoodsListFromServerUntil.getRgid(wingGoods);
                if (goodstable == null) {
                    return;
                }
                Sprite sprite = SpriteFactory.Prepare(GetTcpPath.getMouseTcp("tx/" + goodstable.getSkin() + "1"));
                if (sprite != null) {
                    sprite.updateToTime(ImageMixDeal.userimg.getTime(), 4);
                    sprite.draw(g, 131, 390);
                }
            }
        }
    }

    public LHBtn getWingMenuBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (wingMenuBtn == null) {
                wingMenuBtn = new LHBtn("inkImg/newbutton/K64.png", 1, "", 1, this);
                wingMenuBtn.setOpaque(false);
                wingMenuBtn.setBounds(78, 24, 75, 33);
            }
        } else {
            if (wingMenuBtn == null) {
                wingMenuBtn = new LHBtn("img/wing/一级选项卡_翅膀_选中_w80,h120.png", 1, "", 1, this);
                wingMenuBtn.setOpaque(false);
                wingMenuBtn.setBounds(27, 30, 80, 40);
            }
        }
        return wingMenuBtn;
    }

    public void setWingMenuBtn(LHBtn wingMenuBtn) {
        this.wingMenuBtn = wingMenuBtn;
    }

    public LHBtn getUpgradeBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (upgradeBtn == null) {
                upgradeBtn = new LHBtn("inkImg/newbutton/K65.png", 1, "", 2, this);
                upgradeBtn.setOpaque(false);
                upgradeBtn.setBounds(78 + 78, 24, 75, 33);
            }
        } else {
            if (upgradeBtn == null) {
                upgradeBtn = new LHBtn("img/wing/一级选项卡_升级_未选中_w80,h120.png", 1, "", 2, this);
                upgradeBtn.setOpaque(false);
                upgradeBtn.setBounds(109, 30, 80, 40);
            }
        }
        return upgradeBtn;
    }

    public void setUpgradeBtn(LHBtn upgradeBtn) {
        this.upgradeBtn = upgradeBtn;
    }

    public LHBtn getAmtyuranusBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (amtyuranusBtn == null) {
                amtyuranusBtn = new LHBtn("inkImg/newbutton/K67.png", 1, "", 3, this);
                amtyuranusBtn.setOpaque(false);
                amtyuranusBtn.setBounds(78 + 78 * 2, 24, 75, 33);
            }
        } else {
            if (amtyuranusBtn == null) {
                amtyuranusBtn = new LHBtn("img/wing/一级选项卡_升星_未选中_w80,h120.png", 1, "", 3, this);
                amtyuranusBtn.setOpaque(false);
                amtyuranusBtn.setBounds(191, 30, 80, 40);
            }
        }
        return amtyuranusBtn;
    }

    public void setAmtyuranusBtn(LHBtn amtyuranusBtn) {
        this.amtyuranusBtn = amtyuranusBtn;
    }

    public LHBtn getQualityBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (qualityBtn == null) {
                qualityBtn = new LHBtn("inkImg/newbutton/K69.png", 1, "", 4, this);
                qualityBtn.setOpaque(false);
                qualityBtn.setBounds(78 + 78 * 3, 24, 75, 33);
            }
        } else {
            if (qualityBtn == null) {
                qualityBtn = new LHBtn("img/wing/一级选项卡_品质_未选中_w80,h120.png", 1, "", 4, this);
                qualityBtn.setOpaque(false);
                qualityBtn.setBounds(273, 30, 80, 40);
            }
        }
        return qualityBtn;
    }

    public void setQualityBtn(LHBtn qualityBtn) {
        this.qualityBtn = qualityBtn;
    }

    public LHBtn getRecastMenuBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (recastMenuBtn == null) {
                recastMenuBtn = new LHBtn("inkImg/newbutton/lh2.png", 1, "", 5, this);
                recastMenuBtn.setOpaque(false);
                recastMenuBtn.setBounds(78 + 78 * 1, 26, 75, 31);
            }
        } else {
            if (this.recastMenuBtn == null) {
                this.recastMenuBtn = new LHBtn("img/wing/hmlh2.png", 1, "", 5, this);
                this.recastMenuBtn.setOpaque(false);
                this.recastMenuBtn.setBounds(18 + 80*1, 30, 80, 40);
            }
        }

        return this.recastMenuBtn;
    }

    public void setRecastMenuBtn(LHBtn recastBtn) {
        this.recastMenuBtn = recastBtn;
    }

    public LHBtn getRefineryMenuBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (refineryMenuBtn == null) {
                refineryMenuBtn = new LHBtn("inkImg/newbutton/lh1-1.png", 1, "", 6, this);
                refineryMenuBtn.setOpaque(false);
                refineryMenuBtn.setBounds(78 + 78 * 0, 26, 75, 31);
            }
        } else {
            if (refineryMenuBtn == null) {
                refineryMenuBtn = new LHBtn("img/wing/hmlh1.png", 1, "", 6, this);
                refineryMenuBtn.setOpaque(false);
                refineryMenuBtn.setBounds(18, 30, 80, 40);
            }
        }
        return refineryMenuBtn;
    }

    public void setRefineryMenuBtn(LHBtn refineryMenuBtn) {
        this.refineryMenuBtn = refineryMenuBtn;
    }

    public ImageIcon getIconBack() {
        return iconBack;
    }

    public void setIconBack(ImageIcon iconBack) {
        this.iconBack = iconBack;
    }

    public JLabel getWingMinImg() {
        if (wingMinImg == null) {
            wingMinImg = new JLabel();
            wingMinImg.setOpaque(false);
            if (MyIsif.getStyle().equals("水墨UI")) {
                wingMinImg.setBounds(109, 140, 60, 60);
            } else {
                wingMinImg.setBounds(61, 142, 60, 60);
            }
            wingMinImg.addMouseListener(new LHChooseWingGoodsMouseListener(this));
        }
        return wingMinImg;
    }

    public void setWingMinImg(JLabel wingMinImg) {
        this.wingMinImg = wingMinImg;
    }

    public LHBtn getLeftBtn() {
        if (leftBtn == null) {
            if (MyIsif.getStyle().equals("水墨UI")) {
                leftBtn = new LHBtn("inkImg/button/B175.png", 1, "", 10, this);
                leftBtn.setBounds(71, 130, 16, 82);
            } else {
                leftBtn = new LHBtn("img/wing/向左切换_w16,h246.png", 1, "", 10, this);
                leftBtn.setBounds(37, 130, 16, 82);
            }
        }
        return leftBtn;
    }

    public void setLeftBtn(LHBtn leftBtn) {

        this.leftBtn = leftBtn;
    }

    public LHBtn getRightBtn() {
        if (rightBtn == null) {
            if (MyIsif.getStyle().equals("水墨UI")) {
                rightBtn = new LHBtn("inkImg/button/B176.png", 1, "", 11, this);
                rightBtn.setBounds(298, 130, 16, 82);
            } else {
                rightBtn = new LHBtn("img/wing/向右切换_w16,h246.png", 1, "", 11, this);
                rightBtn.setBounds(211, 130, 16, 82);
            }
        }
        return rightBtn;
    }

    public void setRightBtn(LHBtn rightBtn) {
        this.rightBtn = rightBtn;
    }

    public JLabel getWingLevel() {
        if (wingLevel == null) {
            wingLevel = new JLabel("等级:0");
            wingLevel.setFont(UIUtils.TEXT_FONT1);
            wingLevel.setForeground(Color.white);
            if (MyIsif.getStyle().equals("水墨UI")) {
                wingLevel.setBounds(180, 140, 80, 20);
            } else {
                wingLevel.setBounds(126, 142, 80, 20);
            }
            wingLevel.setHorizontalAlignment(0);
        }
        return wingLevel;
    }

    public void setWingLevel(JLabel wingLevel) {
        this.wingLevel = wingLevel;
    }

    public JLabel getWingQuality() {
        if (wingQuality == null) {
            wingQuality = new JLabel("品质:把玩");
            wingQuality.setFont(UIUtils.TEXT_FONT1);
            wingQuality.setForeground(UIUtils.COLOR_PLAY);
            if (MyIsif.getStyle().equals("水墨UI")) {
                wingQuality.setBounds(180, 162, 80, 20);
            } else {
                wingQuality.setBounds(126, 164, 80, 20);
            }
            wingQuality.setHorizontalAlignment(0);
        }
        return wingQuality;
    }

    public JLabel getChooseWingLab() {
        if (this.chooseWingLab == null) {
            this.chooseWingLab = new JLabel("选择翅膀");
            this.chooseWingLab.setFont(UIUtils.TEXT_HY16);
            this.chooseWingLab.setForeground(UIUtils.COLOR_Wing1);
            this.chooseWingLab.setBounds(86, 107, 100, 18);
            this.chooseWingLab.setHorizontalAlignment(0);
        }

        return this.chooseWingLab;
    }

    public void setWingQuality(JLabel wingQuality) {
        this.wingQuality = wingQuality;
    }

    public JLabel getWingStarLevel() {
        if (wingStarLevel == null) {
            wingStarLevel = new JLabel("星级:0/15");
            wingStarLevel.setFont(UIUtils.TEXT_FONT1);
            wingStarLevel.setForeground(Color.yellow);
            if (MyIsif.getStyle().equals("水墨UI")) {
                wingStarLevel.setBounds(180, 184, 80, 20);
            } else {
                wingStarLevel.setBounds(126, 186, 80, 20);
            }
            wingStarLevel.setHorizontalAlignment(0);
        }
        return wingStarLevel;
    }

    public void setWingStarLevel(JLabel wingStarLevel) {
        this.wingStarLevel = wingStarLevel;
    }

    public JLabel getExperience() {
        if (experience == null) {
            experience = new JLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                experience.setBounds(168, 216, 98, 14);
            } else {
                experience.setBounds(98, 215, 110, 14);
            }
            experience.setOpaque(false);

        }
        return experience;
    }

    public void setExperience(JLabel experience) {
        this.experience = experience;
    }

    public ImageIcon getIconBackLeft() {
        return iconBackLeft;
    }

    public void setIconBackLeft(ImageIcon iconBackLeft) {
        this.iconBackLeft = iconBackLeft;
    }

    public int getLeftType() {
        return leftType;
    }

    public void setLeftType(int leftType) {
        this.leftType = leftType;
    }

    //	175 5012
    public JLabel[] getStarLab() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (starLab == null) {
                starLab = new JLabel[15];
                for (int i = 0; i < starLab.length; i++) {
                    starLab[i] = new JLabel();
                    starLab[i].setBounds(130 + i % 5 * 25, 395 + i / 5 * 25, 20, 20);
                    starLab[i].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏(未)w28px,h28px.png", 20, 20));
                    this.add(starLab[i]);
                }
            }
        } else {
            if (starLab == null) {
                starLab = new JLabel[15];
                for (int i = 0; i < starLab.length; i++) {
                    starLab[i] = new JLabel();
                    starLab[i].setBounds(72 + i % 5 * 25, 423 + i / 5 * 25, 20, 20);
                    starLab[i].setIcon(CutButtonImage.getImage("img/xy2uiimg/收藏(未)w28px,h28px.png", 20, 20));
                    this.add(starLab[i]);
                }
            }
        }
        return starLab;
    }

    public void setStarLab(JLabel[] starLab) {
        this.starLab = starLab;
    }

    public ImageIcon getIconBackRight() {
        return iconBackRight;
    }

    public void setIconBackRight(ImageIcon iconBackRight) {
        this.iconBackRight = iconBackRight;
    }

    public JLabel[] getNowAttributeLab() {
        if (nowAttributeLab == null) {
            nowAttributeLab = new JLabel[8];
            if (MyIsif.getStyle().equals("水墨UI")) {
                for (int i = 0; i < nowAttributeLab.length; i++) {
                    nowAttributeLab[i] = new JLabel();
                    nowAttributeLab[i].setBounds(105 + i % 2 * 158, 112 + i / 2 * 22, i % 2 == 0 ? 127 : 65, 20);
                    nowAttributeLab[i].setForeground(Color.white);
                    nowAttributeLab[i].setFont(UIUtils.TEXT_FONT1);
                    this.add(nowAttributeLab[i]);
                }
            } else {
                for (int i = 0; i < nowAttributeLab.length; i++) {
                    nowAttributeLab[i] = new JLabel();
                    this.nowAttributeLab[i].setBounds(125 + i % 2 * 135, 117 + i / 2 * 27, 129 - i % 2 * 66, 21);
                    this.nowAttributeLab[i].setForeground(Color.white);
                    nowAttributeLab[i].setFont(UIUtils.TEXT_FONT1);
                    this.add(nowAttributeLab[i]);
                }
            }
        }
        return nowAttributeLab;
    }

    public void setNowAttributeLab(JLabel[] nowAttributeLab) {
        this.nowAttributeLab = nowAttributeLab;
    }

    public JScrollPane getRuleWingScrollPane() {
        if (this.ruleWingScrollPane == null) {
            this.ruleWingScrollPane = new JScrollPane();
            this.ruleWingScrollPane.getVerticalScrollBar().setUI(new SrcollPanelUI());
            this.ruleWingScrollPane.setOpaque(false);
            this.ruleWingScrollPane.getViewport().setOpaque(false);
            this.ruleWingScrollPane.setBorder(BorderFactory.createEmptyBorder());
            this.ruleWingScrollPane.setVerticalScrollBarPolicy(22);
            this.ruleWingScrollPane.setHorizontalScrollBarPolicy(31);
            if (MyIsif.getStyle().equals("水墨UI")) {
                ruleWingScrollPane.setBounds(232 + 21, 290 + 70, 274, 153);
            } else {
                this.ruleWingScrollPane.setBounds(253, 360, 274, 153);
            }
        }
        return ruleWingScrollPane;
    }

    public void setRuleWingScrollPane(JScrollPane ruleWingScrollPane) {
        this.ruleWingScrollPane = ruleWingScrollPane;
    }

    public int getRightType() {
        return rightType;
    }

    public void setRightType(int rightType) {
        this.rightType = rightType;
    }

    public JLabel getChooseGoodsImg() {
        if (chooseGoodsImg == null) {
            chooseGoodsImg = new JLabel();
            chooseGoodsImg.setBounds(253, 205 + 70, 58, 56);
            chooseGoodsImg.addMouseListener(new LHChooseGoodsMouseListener(this));
        }
        return chooseGoodsImg;
    }

    public void setChooseGoodsImg(JLabel chooseGoodsImg) {
        this.chooseGoodsImg = chooseGoodsImg;
    }

    public JTextField getTextNumber() {
        if (textNumber == null) {
            textNumber = new JTextField("0");
            textNumber.setFont(UIUtils.TEXT_FONT1);
            textNumber.setOpaque(false);
            textNumber.setBorder(null);
            textNumber.setCaretColor(Color.white);
            textNumber.setForeground(Color.white);
            textNumber.setBounds(232 + 160 + 21, 185 + 60 + 70, 35, 17);
            textNumber.getDocument().addDocumentListener(new DocumentListener() {
                @Override
                public void removeUpdate(DocumentEvent e) {
                    String s = textNumber.getText();
                    try {
                        int sum = Integer.parseInt(s);
                        long price = Long.parseLong("1000000");
                        // labTotalsum.setText(price*sum+"");
                        money = new BigDecimal((price * sum));
                    } catch (NumberFormatException e1) {
                    }
                }

                @Override
                public void insertUpdate(DocumentEvent e) {
                    String s = textNumber.getText();
                    try {
                        int sum = Integer.parseInt(s);
                        long price = Long.parseLong("10000000");
                        // labTotalsum.setText(price*sum+"");
                        money = new BigDecimal((price * sum));
                    } catch (NumberFormatException e1) {
                    }

                }

                @Override
                public void changedUpdate(DocumentEvent e) {
                }
            });
            // 限制输入内容为数字切数字不大于100
            textNumber.addKeyListener(new KeyListener() {
                @Override
                public void keyTyped(KeyEvent e) {
                    int charstr = e.getKeyChar();
                    String str = textNumber.getText();
                    if (str.length() == 0) {
                        textNumber.setText(0 + "");
                    }

                    // control the value between 0 and 9
                    if (charstr < KeyEvent.VK_0 || charstr > KeyEvent.VK_9) {
                        e.consume();
                    }
                    if (str.length() == 1) {
                        if (str.equals("0")) {
                            textNumber.setText("");
                        }
                    }
                    if (str.length() > 0) {
                        if (str.length() > 1) {
                            if (str.length() > 2) {
                                e.consume();
                                textNumber.setText(999 + "");
                                int sum = Integer.parseInt(textNumber.getText());
                                long price = Long.parseLong("10000000");
                                // labTotalsum.setText(price*sum+"");
                                money = new BigDecimal((price * sum));
                            }
                        }
                    }
                }

                @Override
                public void keyPressed(KeyEvent e) {
                }

                @Override
                public void keyReleased(KeyEvent e) {
                }
            });
        }
        return textNumber;
    }

    public void setTextNumber(JTextField textNumber) {
        this.textNumber = textNumber;
    }

    public BigDecimal getMoney() {
        return money;
    }

    public void setMoney(BigDecimal money) {
        this.money = money;
    }

    public LHBtn getCultivateBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (cultivateBtn == null) {
                cultivateBtn = new LHBtn("inkImg/newbutton/B20.png", 1, "培养", 18, this, "");
                cultivateBtn.setBounds(580, 345, 59, 24);
                cultivateBtn.setOpaque(false);
            }
            return cultivateBtn;
        } else {
            if (cultivateBtn == null) {
                cultivateBtn = new LHBtn("img/wing/按钮_培养_w71,h72.png", 1, "", 18, this);
                cultivateBtn.setBounds(458, 315, 71, 24);
                cultivateBtn.setOpaque(false);
            }
            return cultivateBtn;
        }
    }

    public void setCultivateBtn(LHBtn cultivateBtn) {
        this.cultivateBtn = cultivateBtn;
    }

    public JLabel[] getGoodsLab() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (goodsLab == null) {
                goodsLab = new JLabel[15];
                for (int i = 0; i < goodsLab.length; i++) {
                    goodsLab[i] = new JLabel();
                    // goodsLab[i].setOpaque(false);
                    goodsLab[i].setBounds(358 + i % 5 * 52, 112 + i / 5 * 52, 52, 52);
                    goodsLab[i].addMouseListener(new LHUpgradeGoodsMouseListener(i, this));
                    this.add(goodsLab[i]);
                }
            }
            return goodsLab;
        } else {
            if (goodsLab == null) {
                goodsLab = new JLabel[15];
                for (int i = 0; i < goodsLab.length; i++) {
                    goodsLab[i] = new JLabel();
                    // goodsLab[i].setOpaque(false);
                    goodsLab[i].setBounds(253 + i % 5 * 51, 360 + i / 5 * 51, 50, 50);
                    goodsLab[i].addMouseListener(new LHUpgradeGoodsMouseListener(i, this));
                    this.add(goodsLab[i]);
                }
            }
            return goodsLab;
        }
    }

    public void setGoodsLab(JLabel[] goodsLab) {
        this.goodsLab = goodsLab;
    }

    public JLabel[] getAttributeLab() {
        if (attributeLab == null) {
            attributeLab = new JLabel[8];
            for (int i = 0; i < attributeLab.length; i++) {
                attributeLab[i] = new JLabel();
                attributeLab[i].setBounds(45 + 230 + i % 2 * 156 + 21, 30 + 15 + i / 2 * 22 + 70, 64, 14);
                attributeLab[i].setOpaque(false);
                attributeLab[i].setHorizontalAlignment(SwingConstants.RIGHT);
                attributeLab[i].setFont(UIUtils.TEXT_FONT1);
                attributeLab[i].setForeground(Color.white);
                this.add(attributeLab[i]);
            }
        }
        return attributeLab;
    }

    public void setAttributeLab(JLabel[] attributeLab) {
        this.attributeLab = attributeLab;
    }

    public JLabel[] getUpStarMaterials() {
        if (upStarMaterials == null) {
            upStarMaterials = new JLabel[5];
            for (int i = 0; i < upStarMaterials.length; i++) {
                upStarMaterials[i] = new JLabel();
                upStarMaterials[i].setOpaque(false);
                upStarMaterials[i].setBounds(253 + i % 5 * 51, 308, 50, 50);
                upStarMaterials[i].addMouseListener(new LHUpStarMouseListener(i, this));
                this.add(upStarMaterials[i]);
            }

        }
        return upStarMaterials;
    }

    public void setUpStarMaterials(JLabel[] upStarMaterials) {
        this.upStarMaterials = upStarMaterials;
    }

    public JLabel[] getQualityLab() {
        if (qualityLab == null) {
            qualityLab = new JLabel[2];
            for (int i = 0; i < qualityLab.length; i++) {
                qualityLab[i] = new JLabel();
                qualityLab[i].setBounds(262 + i * 156, 119, 55, 53);
                qualityLab[i].setOpaque(false);
                qualityLab[i].setVisible(false);
                this.add(qualityLab[i]);
            }
        }
        return qualityLab;
    }

    public void setQualityLab(JLabel[] qualityLab) {
        this.qualityLab = qualityLab;
    }

    public JLabel[] getWingLab() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (wingLab == null) {
                wingLab = new JLabel[25];
                for (int i = 0; i < wingLab.length; i++) {
                    wingLab[i] = new JLabel();
                    wingLab[i].setBounds(360 + i % 5 * 51, 92 + i / 5 * 51, 50, 50);
                    wingLab[i].addMouseListener(new LHGoodsListMouseLitener(i, this));
                    this.add(wingLab[i]);
                }
            }
            return wingLab;
        } else {
            if (wingLab == null) {
                wingLab = new JLabel[25];
                for (int i = 0; i < wingLab.length; i++) {
                    wingLab[i] = new JLabel();
                    wingLab[i].setBounds(263 + i % 5 * 51, 97 + i / 5 * 51, 50, 50);
                    wingLab[i].addMouseListener(new LHGoodsListMouseLitener(i, this));
                    this.add(wingLab[i]);
                }
            }
            return wingLab;
        }

    }

    public void setWingLab(JLabel[] wingLab) {
        this.wingLab = wingLab;
    }

    public JLabel[] getRecastAttrLab() {
        if (recastAttrLab == null) {
            recastAttrLab = new JLabel[4];
            for (int i = 0; i < recastAttrLab.length; i++) {
                recastAttrLab[i] = new JLabel();
                recastAttrLab[i].setBounds(368, 121 + i * 22, 64, 14);
                recastAttrLab[i].setOpaque(false);
                recastAttrLab[i].setFont(UIUtils.TEXT_FONT1);
                recastAttrLab[i].setForeground(Color.white);
                recastAttrLab[i].setHorizontalAlignment(SwingConstants.RIGHT);
                this.add(recastAttrLab[i]);
            }
        }
        return recastAttrLab;
    }

    public void setRecastAttrLab(JLabel[] recastAttrLab) {
        this.recastAttrLab = recastAttrLab;
    }

    public JLabel getRecastNowAttribute() {
        if (recastNowAttribute == null) {
            recastNowAttribute = new JLabel();
            recastNowAttribute.setBounds(262, 121, 55, 53);
            recastNowAttribute.setOpaque(false);
            this.add(recastNowAttribute);
        }
        return recastNowAttribute;
    }

    public void setRecastNowAttribute(JLabel recastNowAttribute) {
        this.recastNowAttribute = recastNowAttribute;
    }

    public LHBtn getRecastBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (this.recastBtn == null) {
                this.recastBtn = new LHBtn("inkImg/newbutton/B20.png", 1, "重铸", 19, this, "");
                this.recastBtn.setBounds(450, 335, 59, 24);
                this.add(this.recastBtn);
            }
            return this.recastBtn;
        } else {
            if (this.recastBtn == null) {
                this.recastBtn = new LHBtn("img/wing/按钮_重铸_w71,h72.png", 1, "", 19, this);
                this.recastBtn.setBounds(416, 283, 71, 24);
                this.add(this.recastBtn);
            }
            return this.recastBtn;
        }
    }

    public LHBtn getWingNextPageBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (wingNextPageBtn == null) {
                wingNextPageBtn = new LHBtn("inkImg/button/8.png", 1, "", 21, this);
                wingNextPageBtn.setBounds(520, 283 + 25, 18, 18);
                this.add(wingNextPageBtn);
            }
        } else {
            if (wingNextPageBtn == null) {
                wingNextPageBtn = new LHBtn("img/xy2uiimg/34_png.button.xy_vscroll$down.png", 1, "", 21, this);
                wingNextPageBtn.setBounds(520, 283 + 25, 19, 20);
                this.add(wingNextPageBtn);
            }
        }
        return wingNextPageBtn;
    }

    public void setWingNextPageBtn(LHBtn wingNextPageBtn) {
        this.wingNextPageBtn = wingNextPageBtn;
    }

    public LHBtn getWingLastPageBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (wingLastPageBtn == null) {
                wingLastPageBtn = new LHBtn("inkImg/button/7.png", 1, "", 22, this);
                wingLastPageBtn.setBounds(520, 283, 18, 18);
                this.add(wingLastPageBtn);
            }
        } else {
            if (wingLastPageBtn == null) {
                wingLastPageBtn = new LHBtn("img/xy2uiimg/42_png.button.btn_1.png", 1, "", 22, this);
                wingLastPageBtn.setBounds(520, 283, 19, 19);
                this.add(wingLastPageBtn);
            }
        }
        return wingLastPageBtn;
    }

    public void setWingLastPageBtn(LHBtn wingLastPageBtn) {
        this.wingLastPageBtn = wingLastPageBtn;
    }

    public LHBtn getRefineryBtn() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (this.refineryBtn == null) {
                this.refineryBtn = new LHBtn("inkImg/newbutton/B20.png", 1, "炼化", 20, this, "");
                this.refineryBtn.setBounds(320, 297, 59, 24);
                this.add(this.refineryBtn);
            }

            return this.refineryBtn;
        } else {
            if (this.refineryBtn == null) {
                this.refineryBtn = new LHBtn("img/wing/按钮_炼化_w71,h72.png", 1, "", 20, this);
                this.refineryBtn.setBounds(310, 300, 71, 24);
                this.add(this.refineryBtn);
            }

            return this.refineryBtn;
        }
    }
    public int getPageNumber() {
        return pageNumber;
    }

    public void setPageNumber(int pageNumber) {
        this.pageNumber = pageNumber;
    }

    public JLabel getNumberLab() {
        if (numberLab == null) {
            numberLab = new JLabel();
            numberLab.setBounds(412, 315, 36, 16);
            // numberLab.setOpaque(false);
            numberLab.setForeground(Color.white);
            numberLab.setVisible(false);
            this.add(numberLab);

        }
        return numberLab;
    }

    public void setNumberLab(JLabel numberLab) {
        this.numberLab = numberLab;
    }

    public BigDecimal getWingGoods() {
        return wingGoods;
    }

    public void setWingGoods(BigDecimal wingGoods) {
        this.wingGoods = wingGoods;
    }

    public Goodstable getChosegoods() {
        return chosegoods;
    }

    public void setChosegoods(Goodstable chosegoods) {
        this.chosegoods = chosegoods;
    }

    public JLabel[] getQualityNowLab() {
        if (MyIsif.getStyle().equals("水墨UI")) {
            if (qualityNowLab == null) {
                qualityNowLab = new JLabel[2];
                for (int i = 0; i < qualityNowLab.length; i++) {
                    qualityNowLab[i] = new JLabel();
                    qualityNowLab[i].setBounds(432 + i * 159, 119, 46, 18);
                    qualityNowLab[i].setFont(UIUtils.TEXT_FONT1);
                    qualityNowLab[i].setForeground(Color.white);
                    qualityNowLab[i].setHorizontalAlignment(SwingConstants.CENTER);
                    this.add(qualityNowLab[i]);
                }
            }
            return qualityNowLab;
        } else {
            if (qualityNowLab == null) {
                qualityNowLab = new JLabel[2];
                for (int i = 0; i < qualityNowLab.length; i++) {
                    qualityNowLab[i] = new JLabel();
                    qualityNowLab[i].setBounds(320 + i * 156, 119, 46, 18);
                    qualityNowLab[i].setFont(UIUtils.TEXT_FONT1);
                    qualityNowLab[i].setForeground(Color.white);
                    qualityNowLab[i].setHorizontalAlignment(SwingConstants.CENTER);
                    this.add(qualityNowLab[i]);
                }
            }
            return qualityNowLab;
        }
    }

    public void setQualityNowLab(JLabel[] qualityNowLab) {
        this.qualityNowLab = qualityNowLab;
    }

    public int getWingGoodsType() {
        return wingGoodsType;
    }

    public void setWingGoodsType(int wingGoodsType) {
        this.wingGoodsType = wingGoodsType;
    }

    public JLabel[] getWingRefining() {
        if (wingRefining == null) {
            wingRefining = new JLabel[4];
            if (MyIsif.getStyle().equals("水墨UI")) {
                for (int i = 0; i < wingRefining.length; i++) {
                    wingRefining[i] = new JLabel();
                    wingRefining[i].setBounds(237, 115 + i * 22, 15, 15);
                    wingRefining[i].addMouseListener(new LHChooseRefiningCheckboxMouseListener(i, this));
                    this.add(wingRefining[i]);
                }
            } else {
                for (int i = 0; i < wingRefining.length; i++) {
                    wingRefining[i] = new JLabel();
                    wingRefining[i].setBounds(232, 120 + i * 27, 15, 15);
                    wingRefining[i].addMouseListener(new LHChooseRefiningCheckboxMouseListener(i, this));
                    this.add(wingRefining[i]);
                }
            }
        }
        return wingRefining;
    }

    public void setWingRefining(JLabel[] wingRefining) {
        this.wingRefining = wingRefining;
    }

    public boolean[] getWingRefiningType() {
        if (wingRefiningType == null) {
            wingRefiningType = new boolean[4];
            for (int i = 0; i < wingRefiningType.length; i++) {
                wingRefiningType[i] = false;
//				if(wingRefiningType[i]) {
//				}else {
//					wingRefiningType[i] = true;
//				}
            }
        }
        return wingRefiningType;
    }

    public void setWingRefiningType(boolean[] wingRefiningType) {
        this.wingRefiningType = wingRefiningType;
    }

    public JLabel getRefiningTitle() {
        if (refiningTitle == null) {
            refiningTitle = new JLabel();
            if (MyIsif.getStyle().equals("水墨UI")) {
                refiningTitle.setBounds(100, 210, 278, 20);
                refiningTitle.setForeground(Color.black);
            } else {
                refiningTitle.setForeground(Color.white);
                refiningTitle.setBounds(100, 235, 278, 20);
            }
//			refiningTitle.setOpaque(true);
            refiningTitle.setFont(UIUtils.TEXT_FONT1);
            this.add(refiningTitle);
        }
        return refiningTitle;
    }

    public void setRefiningTitle(JLabel refiningTitle) {
        this.refiningTitle = refiningTitle;
    }


}
